package com.nbsaas.boot.project.rest.convert;

import com.nbsaas.boot.project.data.entity.BusinessModel;
import com.nbsaas.boot.project.api.domain.simple.BusinessModelSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class BusinessModelSimpleConvert implements Converter<BusinessModelSimple, BusinessModel> {




@Override
public BusinessModelSimple convert(BusinessModel source) {
    BusinessModelSimple result = new BusinessModelSimple();

                result.setName(source.getName());
                result.setEnName(source.getEnName());
                if(source.getProject()!=null){
                    result.setProject(source.getProject().getId());
                }
                result.setId(source.getId());
                if(source.getProject()!=null){
                    result.setProjectName(source.getProject().getName());
                }
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}